#! /bin/bash
#medical-f1.sh start/stop
#1、判断参数是否传入
if [ $# -lt 1 ]
then
	echo "必须传入start/stop..."
	exit
fi
#2、根据参数启动/停止flume
case $1 in
"start")
	ssh hadoop102 "nohup /opt/module/flume/bin/flume-ng agent -n a1 -c /opt/module/flume/conf/ -f /opt/module/flume/job/kafka_to_hdfs.conf -Dflume.root.logger=INFO,console >/opt/module/flume/log.txt 2>&1 &"
;;
"stop")
	ssh hadoop102 "ps -ef |grep flume|grep -v grep|awk '{print \$2}'|xargs kill -9"
;;
*)
	echo "参数输入错误..."
;;
esac
